Creates a Comment object, which may then be used to be added to the CommentsFromLearner list.
Parent Type: LearningDataModel
Namespace: Microsoft.LearningComponents.DataModel
Assembly: Microsoft.LearningComponents.dll
| C# |
|
public Comment CreateComment () |
A new Comment object associated with this LearningDataModel.
| Exception type | Condition |
| InvalidOperationException | Thrown if this LearningDataModel object cannot be written to. |
The following example demonstrates creating a new comment and adding it to the CommentsFromLearner collection.
| C# |
LearningSession session = ... ; // get LearningSession object
Comment c = session.CurrentActivityDataModel.CreateComment();
c.Location = "Question #3";
c.CommentText = "I don't understand this question.";
c.Timestamp = DateTime.UtcNow.ToString("yyyy-MM-ddTHH:mm:ss.ffZ");
session.CurrentActivityDataModel.CommentsFromLearner.Add(c);
|